<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var number = prompt("请输入的数字是(0~23之间)");
        if (number < 6) {
            alert("上午好");
        } else if (number < 12) {
            alert("中午好");
        } else if (number < 18) {
            alert("晚上好");
        } else if (number < 24) {
            alert("这是休息时间，不要说话！")
        }
    </script>
</body>

</html>